package org.csc.sss.util.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

@Component
public class ProfileUtils {
    /**
     * 当前系统环境
     */
    @Autowired
    private Environment env;

    public void test(){
        String[] arr = env.getActiveProfiles();
        List<String> list = Arrays.asList(arr);
        if (list.contains("test")) {
            System.out.println("当前配置环境 ------------> test");
        }
    }
}
